package com.renli.service.impl;

import com.renli.mapper.PermissionMapper;
import com.renli.pojo.Login;
import com.renli.pojo.Permission;
import com.renli.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class PermissionServiceImpl implements PermissionService {

    @Autowired
    private PermissionMapper permissionMapper;

    @Override
    public List<Permission> findByLogin(Login login) {

        System.out.println(login);
      return   permissionMapper.selectByLogin(login);
    }

    @Override
    public List<Permission> findPermByUserId(Integer menuId, Integer userId) {

        return permissionMapper.selectByUserId(menuId,userId);
    }

    @Override
    public List<Permission> findByRoleId(Integer id) {

        return permissionMapper.selectByRoleId(id);
    }
}
